@import '../../style/themes/index';
@import './token.less';

@notice-prefix-cls: ~'@{kd-prefix}-notice';
@notice-box: ~'@{notice-prefix-cls}-box';

.@{notice-box}-topRight, .@{notice-box}-topLeft, .@{notice-box}-bottomLeft, .@{notice-box}-bottomRight {
  position: fixed;
  z-index: @notice-z-index;
}


.@{notice-prefix-cls} {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 320px;
  margin: 0 auto 16px;
  box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  background-color: @notice-content-color-background;
  animation: kdNoticeEffect @notice-motion-duration cubic-bezier(0,.4,.4,1) forwards;

  &-content {
    width: 100%;

    &-title {
      height: 40px;
      line-height: 40px;
      white-space: nowrap;
      padding: 0 20px;
      display: flex;
      font-size: @notice-font-size;
      align-content: center;
      justify-content: space-between;

      &-left {
        flex: 1;
        margin-right: 20px;
        display: flex;
        align-items: center;

        &-icon {
          margin-right: 5px;
          font-size: 17px;
        }

        &-text {
          flex: 1;
          font-weight: 600;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }

      &-close {
        cursor: pointer;
      }
    }

    &-description {
      height: 46px;
      padding: 10px 20px;
      font-size: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    &-footer {
      display: flex;
      align-items: center;
      padding: 0 20px 15px 20px;
      font-size: 12px;
      color: @notice-footer-color;
      cursor: pointer;

      > div {
        margin-right: 10px;

        &:hover {
          color: @notice-footer-color-hover;
        }
      }
    }
  }

  &-info {
    .@{notice-prefix-cls}-content-title {
      color: @notice-info-color;
      background: @notice-info-header-color-background;

      &-left-icon {
        color: @notice-icon-color;
      }

      &-close {
        color: @notice-icon-color;

        &:hover {
          color: @notice-icon-color-hover;
        }
      }
    }


  }

  &-primary {
    .@{notice-prefix-cls}-content-title {
      color: @notice-header-color;
      background: @notice-header-color-background;

      &-close {
        color: @notice-header-color;

        &:hover {
          color: @notice-icon-color-hover;
        }
      }
    }
  }

  &-leave {
    animation: kdNoticeLeaveEffect @notice-motion-duration cubic-bezier(0,.4,.4,1) forwards;
  }

  &-leave-after {
    padding: 0;
    margin: 0;
    opacity: 0;
    transition: all @notice-motion-duration cubic-bezier(0,.4,.4,1);

    &.@{notice-prefix-cls}-success,
    &.@{notice-prefix-cls}-warning,
    &.@{notice-prefix-cls}-error {
      transition: all @notice-motion-duration cubic-bezier(0,.4,.4,1);
      border: none;
    }

    & div, & i {
      transition: all @notice-motion-duration cubic-bezier(0,.4,.4,1);
      height: 0;
      font-size: 0;
    }
  }
}
